(0) Obligation:

Clauses:

mul(X1, 0, Z) :- ','(!, eq(Z, 0)).
mul(X, Y, Z) :- ','(p(Y, P), ','(mul(X, P, V), add(X, V, Z))).
add(X, 0, Z) :- ','(!, eq(Z, X)).
add(X, Y, Z) :- ','(p(Y, V), ','(add(X, V, W), p(Z, W))).
p(0, 0).
p(s(X), X).
eq(X, X).

Query: mul(g,g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

mulA(X1, s(X2), X3) :- mulA(X1, X2, X4).
mulA(X1, s(X2), X3) :- ','(mulcA(X1, X2, X4), addB(X1, X4, X3)).
addB(X1, s(X2), X3) :- addB(X1, X2, X4).
mulC(X1, s(X2), X3) :- mulA(X1, X2, X4).
mulC(X1, s(X2), X3) :- ','(mulcA(X1, X2, s(X4)), addB(X1, X4, X5)).

Clauses:

mulcA(X1, 0, 0).
mulcA(X1, s(X2), X3) :- ','(mulcA(X1, X2, X4), addcB(X1, X4, X3)).
addcB(X1, 0, X1).
addcB(X1, s(X2), 0) :- addcB(X1, X2, 0).
addcB(X1, s(X2), s(X3)) :- addcB(X1, X2, X3).

Afs:

mulC(x1, x2, x3)  =  mulC(x1, x2)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
mulC_in: (b,b,f)
mulA_in: (b,b,f)
mulcA_in: (b,b,f)
addcB_in: (b,b,f) (b,b,b)
addB_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

MULC_IN_GGA(X1, s(X2), X3) → U5_GGA(X1, X2, X3, mulA_in_gga(X1, X2, X4))
MULC_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)
MULA_IN_GGA(X1, s(X2), X3) → U1_GGA(X1, X2, X3, mulA_in_gga(X1, X2, X4))
MULA_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)
MULA_IN_GGA(X1, s(X2), X3) → U2_GGA(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U2_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U3_GGA(X1, X2, X3, addB_in_gga(X1, X4, X3))
U2_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → ADDB_IN_GGA(X1, X4, X3)
ADDB_IN_GGA(X1, s(X2), X3) → U4_GGA(X1, X2, X3, addB_in_gga(X1, X2, X4))
ADDB_IN_GGA(X1, s(X2), X3) → ADDB_IN_GGA(X1, X2, X4)
MULC_IN_GGA(X1, s(X2), X3) → U6_GGA(X1, X2, X3, mulcA_in_gga(X1, X2, s(X4)))
U6_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, s(X4))) → U7_GGA(X1, X2, X3, addB_in_gga(X1, X4, X5))
U6_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, s(X4))) → ADDB_IN_GGA(X1, X4, X5)

The TRS R consists of the following rules:

mulcA_in_gga(X1, 0, 0) → mulcA_out_gga(X1, 0, 0)
mulcA_in_gga(X1, s(X2), X3) → U9_gga(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U9_gga(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U10_gga(X1, X2, X3, addcB_in_gga(X1, X4, X3))
addcB_in_gga(X1, 0, X1) → addcB_out_gga(X1, 0, X1)
addcB_in_gga(X1, s(X2), 0) → U11_gga(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, 0, X1) → addcB_out_ggg(X1, 0, X1)
addcB_in_ggg(X1, s(X2), 0) → U11_ggg(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, s(X2), s(X3)) → U12_ggg(X1, X2, X3, addcB_in_ggg(X1, X2, X3))
U12_ggg(X1, X2, X3, addcB_out_ggg(X1, X2, X3)) → addcB_out_ggg(X1, s(X2), s(X3))
U11_ggg(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_ggg(X1, s(X2), 0)
U11_gga(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_gga(X1, s(X2), 0)
addcB_in_gga(X1, s(X2), s(X3)) → U12_gga(X1, X2, X3, addcB_in_gga(X1, X2, X3))
U12_gga(X1, X2, X3, addcB_out_gga(X1, X2, X3)) → addcB_out_gga(X1, s(X2), s(X3))
U10_gga(X1, X2, X3, addcB_out_gga(X1, X4, X3)) → mulcA_out_gga(X1, s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulA_in_gga(x1, x2, x3)  =  mulA_in_gga(x1, x2)
mulcA_in_gga(x1, x2, x3)  =  mulcA_in_gga(x1, x2)
0  =  0
mulcA_out_gga(x1, x2, x3)  =  mulcA_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addcB_in_gga(x1, x2, x3)  =  addcB_in_gga(x1, x2)
addcB_out_gga(x1, x2, x3)  =  addcB_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addcB_in_ggg(x1, x2, x3)  =  addcB_in_ggg(x1, x2, x3)
addcB_out_ggg(x1, x2, x3)  =  addcB_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
addB_in_gga(x1, x2, x3)  =  addB_in_gga(x1, x2)
MULC_IN_GGA(x1, x2, x3)  =  MULC_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
MULA_IN_GGA(x1, x2, x3)  =  MULA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
ADDB_IN_GGA(x1, x2, x3)  =  ADDB_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MULC_IN_GGA(X1, s(X2), X3) → U5_GGA(X1, X2, X3, mulA_in_gga(X1, X2, X4))
MULC_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)
MULA_IN_GGA(X1, s(X2), X3) → U1_GGA(X1, X2, X3, mulA_in_gga(X1, X2, X4))
MULA_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)
MULA_IN_GGA(X1, s(X2), X3) → U2_GGA(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U2_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U3_GGA(X1, X2, X3, addB_in_gga(X1, X4, X3))
U2_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → ADDB_IN_GGA(X1, X4, X3)
ADDB_IN_GGA(X1, s(X2), X3) → U4_GGA(X1, X2, X3, addB_in_gga(X1, X2, X4))
ADDB_IN_GGA(X1, s(X2), X3) → ADDB_IN_GGA(X1, X2, X4)
MULC_IN_GGA(X1, s(X2), X3) → U6_GGA(X1, X2, X3, mulcA_in_gga(X1, X2, s(X4)))
U6_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, s(X4))) → U7_GGA(X1, X2, X3, addB_in_gga(X1, X4, X5))
U6_GGA(X1, X2, X3, mulcA_out_gga(X1, X2, s(X4))) → ADDB_IN_GGA(X1, X4, X5)

The TRS R consists of the following rules:

mulcA_in_gga(X1, 0, 0) → mulcA_out_gga(X1, 0, 0)
mulcA_in_gga(X1, s(X2), X3) → U9_gga(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U9_gga(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U10_gga(X1, X2, X3, addcB_in_gga(X1, X4, X3))
addcB_in_gga(X1, 0, X1) → addcB_out_gga(X1, 0, X1)
addcB_in_gga(X1, s(X2), 0) → U11_gga(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, 0, X1) → addcB_out_ggg(X1, 0, X1)
addcB_in_ggg(X1, s(X2), 0) → U11_ggg(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, s(X2), s(X3)) → U12_ggg(X1, X2, X3, addcB_in_ggg(X1, X2, X3))
U12_ggg(X1, X2, X3, addcB_out_ggg(X1, X2, X3)) → addcB_out_ggg(X1, s(X2), s(X3))
U11_ggg(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_ggg(X1, s(X2), 0)
U11_gga(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_gga(X1, s(X2), 0)
addcB_in_gga(X1, s(X2), s(X3)) → U12_gga(X1, X2, X3, addcB_in_gga(X1, X2, X3))
U12_gga(X1, X2, X3, addcB_out_gga(X1, X2, X3)) → addcB_out_gga(X1, s(X2), s(X3))
U10_gga(X1, X2, X3, addcB_out_gga(X1, X4, X3)) → mulcA_out_gga(X1, s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulA_in_gga(x1, x2, x3)  =  mulA_in_gga(x1, x2)
mulcA_in_gga(x1, x2, x3)  =  mulcA_in_gga(x1, x2)
0  =  0
mulcA_out_gga(x1, x2, x3)  =  mulcA_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addcB_in_gga(x1, x2, x3)  =  addcB_in_gga(x1, x2)
addcB_out_gga(x1, x2, x3)  =  addcB_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addcB_in_ggg(x1, x2, x3)  =  addcB_in_ggg(x1, x2, x3)
addcB_out_ggg(x1, x2, x3)  =  addcB_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
addB_in_gga(x1, x2, x3)  =  addB_in_gga(x1, x2)
MULC_IN_GGA(x1, x2, x3)  =  MULC_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
MULA_IN_GGA(x1, x2, x3)  =  MULA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
ADDB_IN_GGA(x1, x2, x3)  =  ADDB_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 10 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ADDB_IN_GGA(X1, s(X2), X3) → ADDB_IN_GGA(X1, X2, X4)

The TRS R consists of the following rules:

mulcA_in_gga(X1, 0, 0) → mulcA_out_gga(X1, 0, 0)
mulcA_in_gga(X1, s(X2), X3) → U9_gga(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U9_gga(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U10_gga(X1, X2, X3, addcB_in_gga(X1, X4, X3))
addcB_in_gga(X1, 0, X1) → addcB_out_gga(X1, 0, X1)
addcB_in_gga(X1, s(X2), 0) → U11_gga(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, 0, X1) → addcB_out_ggg(X1, 0, X1)
addcB_in_ggg(X1, s(X2), 0) → U11_ggg(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, s(X2), s(X3)) → U12_ggg(X1, X2, X3, addcB_in_ggg(X1, X2, X3))
U12_ggg(X1, X2, X3, addcB_out_ggg(X1, X2, X3)) → addcB_out_ggg(X1, s(X2), s(X3))
U11_ggg(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_ggg(X1, s(X2), 0)
U11_gga(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_gga(X1, s(X2), 0)
addcB_in_gga(X1, s(X2), s(X3)) → U12_gga(X1, X2, X3, addcB_in_gga(X1, X2, X3))
U12_gga(X1, X2, X3, addcB_out_gga(X1, X2, X3)) → addcB_out_gga(X1, s(X2), s(X3))
U10_gga(X1, X2, X3, addcB_out_gga(X1, X4, X3)) → mulcA_out_gga(X1, s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulcA_in_gga(x1, x2, x3)  =  mulcA_in_gga(x1, x2)
0  =  0
mulcA_out_gga(x1, x2, x3)  =  mulcA_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addcB_in_gga(x1, x2, x3)  =  addcB_in_gga(x1, x2)
addcB_out_gga(x1, x2, x3)  =  addcB_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addcB_in_ggg(x1, x2, x3)  =  addcB_in_ggg(x1, x2, x3)
addcB_out_ggg(x1, x2, x3)  =  addcB_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
ADDB_IN_GGA(x1, x2, x3)  =  ADDB_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ADDB_IN_GGA(X1, s(X2), X3) → ADDB_IN_GGA(X1, X2, X4)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADDB_IN_GGA(x1, x2, x3)  =  ADDB_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ADDB_IN_GGA(X1, s(X2)) → ADDB_IN_GGA(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • ADDB_IN_GGA(X1, s(X2)) → ADDB_IN_GGA(X1, X2)
    The graph contains the following edges 1 >= 1, 2 > 2

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MULA_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)

The TRS R consists of the following rules:

mulcA_in_gga(X1, 0, 0) → mulcA_out_gga(X1, 0, 0)
mulcA_in_gga(X1, s(X2), X3) → U9_gga(X1, X2, X3, mulcA_in_gga(X1, X2, X4))
U9_gga(X1, X2, X3, mulcA_out_gga(X1, X2, X4)) → U10_gga(X1, X2, X3, addcB_in_gga(X1, X4, X3))
addcB_in_gga(X1, 0, X1) → addcB_out_gga(X1, 0, X1)
addcB_in_gga(X1, s(X2), 0) → U11_gga(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, 0, X1) → addcB_out_ggg(X1, 0, X1)
addcB_in_ggg(X1, s(X2), 0) → U11_ggg(X1, X2, addcB_in_ggg(X1, X2, 0))
addcB_in_ggg(X1, s(X2), s(X3)) → U12_ggg(X1, X2, X3, addcB_in_ggg(X1, X2, X3))
U12_ggg(X1, X2, X3, addcB_out_ggg(X1, X2, X3)) → addcB_out_ggg(X1, s(X2), s(X3))
U11_ggg(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_ggg(X1, s(X2), 0)
U11_gga(X1, X2, addcB_out_ggg(X1, X2, 0)) → addcB_out_gga(X1, s(X2), 0)
addcB_in_gga(X1, s(X2), s(X3)) → U12_gga(X1, X2, X3, addcB_in_gga(X1, X2, X3))
U12_gga(X1, X2, X3, addcB_out_gga(X1, X2, X3)) → addcB_out_gga(X1, s(X2), s(X3))
U10_gga(X1, X2, X3, addcB_out_gga(X1, X4, X3)) → mulcA_out_gga(X1, s(X2), X3)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulcA_in_gga(x1, x2, x3)  =  mulcA_in_gga(x1, x2)
0  =  0
mulcA_out_gga(x1, x2, x3)  =  mulcA_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addcB_in_gga(x1, x2, x3)  =  addcB_in_gga(x1, x2)
addcB_out_gga(x1, x2, x3)  =  addcB_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addcB_in_ggg(x1, x2, x3)  =  addcB_in_ggg(x1, x2, x3)
addcB_out_ggg(x1, x2, x3)  =  addcB_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
MULA_IN_GGA(x1, x2, x3)  =  MULA_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MULA_IN_GGA(X1, s(X2), X3) → MULA_IN_GGA(X1, X2, X4)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
MULA_IN_GGA(x1, x2, x3)  =  MULA_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MULA_IN_GGA(X1, s(X2)) → MULA_IN_GGA(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • MULA_IN_GGA(X1, s(X2)) → MULA_IN_GGA(X1, X2)
    The graph contains the following edges 1 >= 1, 2 > 2

(20) YES